package factory.simplefactory.order;

import factory.simplefactory.dumpling.BaiCaiDumpling;
import factory.simplefactory.dumpling.Dumpling;
import factory.simplefactory.dumpling.JiuCaiDumpling;

/**
 * @author desire
 */
public class SimpleFactory {

    public Dumpling createDumpling(String orderType){
        Dumpling dumpling = null;
        System.out.println("使用简单工厂模式");

        if("jiucai".equals(orderType)){
            dumpling = new JiuCaiDumpling();
            dumpling.setName("韭菜饺子");
        }else if("baicai".equals(orderType)){
            dumpling = new BaiCaiDumpling();
            dumpling.setName("白菜饺子");
        }

        return dumpling;

    }


}
